home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 September / SGI IRIX Patches 1995 Sep.iso / 5.3_patches / patchSG0000676 / patchSG0000676.idb / usr / include / sys / stream.h.z / stream.h
C/C++ Source or Header  |  1995-09-07  |  18KB  |  628 lines

  1. /*    Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_STREAM_H    /* wrapper symbol for kernel use */
  11. #define _SYS_STREAM_H    /* subject to change without notice */
  12.  
  13. #ident    "@(#)uts-3b2:io/stream.h    1.4"
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. #include <sys/strmdep.h> /* XXXrs needed? */
  20.  
  21. #define _EAGER_RUNQUEUES
  22.  
  23. #ifdef _IRIX_LATER
  24. #include <sys/poll.h>
  25. #endif /* _IRIX_LATER */
  26. #include <sys/cdefs.h>
  27.  
  28. #ifdef _KERNEL
  29. #define free kern_free
  30. #define malloc kern_malloc
  31. #define calloc kern_calloc
  32. #endif /* _KERNEL */
  33.  
  34. struct cred;
  35.  
  36. /*
  37.  * Data queue
  38.  */
  39.  
  40. struct    queue {
  41.     struct    qinit    *q_qinfo;    /* procs and limits for queue */
  42.     struct    msgb    *q_first;    /* first data block */
  43.     struct    msgb    *q_last;    /* last data block */
  44.     struct    queue    *q_next;    /* Q of next stream */
  45.     struct    queue    *q_link;    /* to next Q for scheduling */
  46.     void        *q_ptr;        /* to private data structure */
  47.     ulong        q_count;    /* number of bytes on Q */
  48.     ulong        q_flag;        /* queue state */
  49.     long        q_minpsz;    /* min packet size accepted by */
  50.                     /* this module */
  51.     long        q_maxpsz;    /* max packet size accepted by */
  52.                     /* this module */
  53.     ulong        q_hiwat;    /* queue high water mark */
  54.     ulong        q_lowat;    /* queue low water mark */
  55.     struct qband    *q_bandp;    /* separate flow information */
  56.     unsigned char    q_nband;    /* number of priority bands > 0 */
  57.     unsigned char    q_blocked;    /* number of bands flow controlled */
  58.     unsigned char    q_pad1[2];    /* reserved for future use */
  59.     long        q_pad2[2];    /* reserved for future use */
  60. };
  61.  
  62.  
  63. typedef struct queue queue_t;
  64.  
  65. /*
  66.  * Queue flags
  67.  */
  68. #define    QENAB    0x001            /* Queue is already enabled to run */
  69. #define    QWANTR    0x002            /* Someone wants to read Q */
  70. #define    QWANTW    0x004            /* Someone wants to write Q */
  71. #define    QFULL    0x008            /* Q is considered full */
  72. #define    QREADR    0x010            /* This is the reader (first) Q */
  73. #define    QUSE    0x020            /* This queue in use (allocation) */
  74. #define    QNOENB    0x040            /* Don't enable Q via putq */
  75. #define    QOLD    0x080            /* Pre-SVR4 open/close interface */
  76. #define QBACK    0x100            /* queue has been back-enabled */
  77. #define QHLIST    0x200            /* STRHOLD active on queue */
  78.  
  79. /*
  80.  * Structure that describes the separate information
  81.  * for each priority band in the queue.
  82.  */
  83. struct qband {
  84.     struct qband    *qb_next;    /* next band's info */
  85.     ulong        qb_count;    /* number of bytes in band */
  86.     struct msgb    *qb_first;    /* beginning of band's data */
  87.     struct msgb    *qb_last;    /* end of band's data */
  88.     ulong        qb_hiwat;    /* high water mark for band */
  89.     ulong        qb_lowat;    /* low water mark for band */
  90.     ulong        qb_flag;    /* see below */
  91.     long        qb_pad1;    /* reserved for future use */
  92. };
  93.  
  94. typedef struct qband qband_t;
  95.  
  96. /*
  97.  * qband flags
  98.  */
  99. #define QB_FULL        0x01        /* band is considered full */
  100. #define QB_WANTW    0x02        /* Someone wants to write to band */
  101. #define QB_BACK        0x04        /* queue has been back-enabled */
  102.  
  103. /*
  104.  * Maximum number of bands.
  105.  */
  106. #define NBAND    256
  107.  
  108. /*
  109.  * Fields that can be manipulated through strqset() and strqget().
  110.  */
  111. typedef enum qfields {
  112.     QHIWAT    = 0,        /* q_hiwat or qb_hiwat */
  113.     QLOWAT    = 1,        /* q_lowat or qb_lowat */
  114.     QMAXPSZ    = 2,        /* q_maxpsz */
  115.     QMINPSZ    = 3,        /* q_minpsz */
  116.     QCOUNT    = 4,        /* q_count or qb_count */
  117.     QFIRST    = 5,        /* q_first or qb_first */
  118.     QLAST    = 6,        /* q_last or qb_last */
  119.     QFLAG    = 7,        /* q_flag or qb_flag */
  120.     QBAD    = 8
  121. } qfields_t;
  122.  
  123. /*
  124.  * Module information structure
  125.  */
  126.  
  127.  
  128. struct module_info {
  129.     ushort    mi_idnum;        /* module id number */
  130.     char     *mi_idname;        /* module name */
  131.     long    mi_minpsz;        /* min packet size accepted */
  132.     long    mi_maxpsz;        /* max packet size accepted */
  133.     ulong    mi_hiwat;        /* hi-water mark */
  134.     ulong     mi_lowat;        /* lo-water mark */
  135.     ushort    mi_locking;
  136.     ushort    mi_processor;
  137. };
  138.  
  139.  
  140. #define STREAMS_LOCK_MONITOR    0       /* monitor locking */
  141. #define STREAMS_LOCK_PROCESSOR  1       /* lock module to a processor */
  142.  
  143. struct qinit;
  144.  
  145. /*
  146.  * Streamtab (used in cdevsw and fmodsw to point to module or driver)
  147.  */
  148.  
  149. struct streamtab {
  150.     struct qinit *st_rdinit;
  151.     struct qinit *st_wrinit;
  152.     struct qinit *st_muxrinit;
  153.     struct qinit *st_muxwinit;
  154. };
  155.  
  156. /*
  157.  * Structure sent to mux drivers to indicate a link.
  158.  */
  159.  
  160. struct linkblk {
  161.     queue_t *l_qtop;    /* lowest level write queue of upper stream */
  162.                 /* (set to NULL for persistent links) */
  163.     queue_t *l_qbot;    /* highest level write queue of lower stream */
  164.     int      l_index;    /* index for lower stream. */
  165.     long     l_pad[5];    /* reserved for future use */
  166. };
  167.  
  168.  
  169. /*
  170.  * Class 0 data buffer freeing routine
  171.  */
  172. struct free_rtn {
  173.     void (*free_func)(char *);
  174.     char *free_arg;
  175. };
  176.  
  177. /*
  178.  *  Data block descriptor
  179.  */
  180.  
  181.  
  182. struct datab {
  183.     union {
  184.         struct datab    *freep;
  185.         struct free_rtn *frtnp;
  186.     } db_f;
  187.     unsigned char    *db_base;
  188.     unsigned char    *db_lim;
  189.     unsigned char    db_ref;
  190.     unsigned char    db_type;
  191.     unsigned char    db_iswhat;    /* status of the mesg/data/buffer triplet */
  192. /* NOTICE that this is a spare byte out of this 3rd word that SGI added */
  193.     unsigned char    db_ztype;    /* zone where data came from */
  194.     unsigned int    db_size;
  195.     caddr_t        db_msgaddr;    /* triplet mesg header that points to datab */
  196.     unsigned char    db_mbufref;    /* ref cnt for use by mbufs,protected by splimp */
  197.     unsigned char    db_pad[3];    /* reserved for future use */
  198. #ifdef STREAMS_MEM_TRACE
  199.     struct str_mem_trace_log tracelog;
  200. #endif /* STREAMS_MEM_TRACE */
  201. };
  202.  
  203.  
  204. #define db_freep db_f.freep
  205. #define db_frtnp db_f.frtnp
  206.  
  207. /*
  208.  * Message block descriptor
  209.  */
  210.  
  211.  
  212. struct    msgb {
  213.     struct    msgb    *b_next;
  214.     struct  msgb    *b_prev;
  215.     struct    msgb    *b_cont;
  216.     unsigned char    *b_rptr;
  217.     unsigned char    *b_wptr;
  218.     struct datab     *b_datap;
  219.     unsigned char    b_band;
  220.     unsigned char    b_pad1;
  221.     unsigned short    b_flag;
  222.     long        b_pad2;
  223. };
  224.  
  225.  
  226. typedef struct msgb mblk_t;
  227. typedef struct datab dblk_t;
  228. typedef struct free_rtn frtn_t;
  229.  
  230.  
  231. /*
  232.  * Message flags.  These are interpreted by the stream head.
  233.  */
  234. #define MSGMARK        0x01        /* last byte of message is "marked" */
  235. #define MSGNOLOOP    0x02        /* don't loop message around to */
  236.                     /* write side of stream */
  237. #define MSGDELIM    0x04        /* message is delimited */
  238. #define MSGNOGET    0x08        /* getq does not return message */
  239.  
  240. /*
  241.  * The following flag is set by the stream head in M_IOCTL messages
  242.  * sent downstream on behalf of an IRIX4 ABI user.
  243.  */
  244. #define MSGI4ABI    0x10
  245.  
  246. /*
  247.  * Streams message types.
  248.  */
  249.  
  250. /*
  251.  * Data and protocol messages (regular and priority)
  252.  */
  253. #define    M_DATA        0x00        /* regular data */
  254. #define M_PROTO        0x01        /* protocol control */
  255.  
  256. /*
  257.  * Control messages (regular and priority)
  258.  */
  259. #define    M_BREAK        0x08        /* line break */
  260. #define M_PASSFP    0x09        /* pass file pointer */
  261. #define M_EVENT        0x0a        /* post an event to an event queue */
  262. #define    M_SIG        0x0b        /* generate process signal */
  263. #define    M_DELAY        0x0c        /* real-time xmit delay (1 param) */
  264. #define M_CTL        0x0d        /* device-specific control message */
  265. #define    M_IOCTL        0x0e        /* ioctl; set/get params */
  266. #define M_SETOPTS    0x10        /* set various stream head options */
  267. #define M_RSE        0x11        /* reserved for RSE use only */
  268.  
  269. /*
  270.  * Control messages (high priority; go to head of queue)
  271.  */
  272. #define    M_IOCACK    0x81        /* acknowledge ioctl */
  273. #define    M_IOCNAK    0x82        /* negative ioctl acknowledge */
  274. #define M_PCPROTO    0x83        /* priority proto message */
  275. #define    M_PCSIG        0x84        /* generate process signal */
  276. #define    M_READ        0x85        /* generate read notification */
  277. #define    M_FLUSH        0x86        /* flush your queues */
  278. #define    M_STOP        0x87        /* stop transmission immediately */
  279. #define    M_START        0x88        /* restart transmission after stop */
  280. #define    M_HANGUP    0x89        /* line disconnect */
  281. #define M_ERROR        0x8a        /* fatal error used to set u.u_error */
  282. #define M_COPYIN    0x8b        /* request to copyin data */
  283. #define M_COPYOUT    0x8c        /* request to copyout data */
  284. #define M_IOCDATA    0x8d        /* response to M_COPYIN and M_COPYOUT */
  285. #define M_PCRSE        0x8e        /* reserved for RSE use only */
  286. #define    M_STOPI        0x8f        /* stop reception immediately */
  287. #define    M_STARTI    0x90        /* restart reception after stop */
  288. #define M_PCEVENT    0x91        /* post an event to an event queue */
  289.  
  290. /*
  291.  * Queue message class definitions.  
  292.  */
  293. #define QNORM        0x00        /* normal priority messages */
  294. #define QPCTL        0x80        /* high priority cntrl messages */
  295.  
  296. /*
  297.  *  IOCTL structure - this structure is the format of the M_IOCTL message type.
  298.  */
  299.  
  300.  
  301. struct iocblk {
  302.     int         ioc_cmd;    /* ioctl command type */
  303.     struct cred    *ioc_cr;    /* full credentials */
  304.     uint        ioc_id;        /* ioctl id */
  305.     uint        ioc_count;    /* count of bytes in data field */
  306.     int        ioc_error;    /* error code */
  307.     int        ioc_rval;    /* return value  */
  308.     long        ioc_filler[4];    /* reserved for future use */
  309. };
  310.  
  311. #define ioc_uid ioc_cr->cr_uid
  312. #define ioc_gid ioc_cr->cr_gid
  313.  
  314.  
  315. /*
  316.  * structure for the M_COPYIN and M_COPYOUT message types.
  317.  */
  318.  
  319.  
  320. struct copyreq {
  321.     int        cq_cmd;        /* ioctl command (from ioc_cmd) */
  322.     struct cred    *cq_cr;        /* full credentials */
  323.     uint        cq_id;        /* ioctl id (from ioc_id) */
  324.     caddr_t        cq_addr;    /* address to copy data to/from */
  325.     uint        cq_size;    /* number of bytes to copy */
  326.     int        cq_flag;    /* see below */
  327.     mblk_t        *cq_private;    /* privtate state information */
  328.     long        cq_filler[4];    /* reserved for future use */
  329. };
  330.  
  331. #define cq_uid cq_cr->cr_uid
  332. #define cq_gid cq_cr->cr_gid
  333.  
  334.  
  335. /* cq_flag values */
  336.  
  337. #define STRCANON    0x01        /* b_cont data block contains */
  338.                     /* canonical format specifier */
  339. #define RECOPY        0x02        /* perform I_STR copyin again, */
  340.                     /* this time using canonical */
  341.                     /* format specifier */
  342. #define STRCOPYTRANS    0x10000000    /* M_COPYOUT data to address
  343.                        specified by driver (cq_addr) */
  344.  
  345.  
  346. /*
  347.  * structure for the M_IOCDATA message type.
  348.  */
  349.  
  350.  
  351. struct copyresp {
  352.     int        cp_cmd;        /* ioctl command (from ioc_cmd) */
  353.     struct cred    *cp_cr;        /* full credentials */
  354.     uint        cp_id;        /* ioctl id (from ioc_id) */
  355.     caddr_t        cp_rval;    /* status of request: 0 -> success */
  356.                     /*             non-zero -> failure */
  357.     uint        cp_pad1;    /* reserved */
  358.     int        cp_pad2;    /* reserved */
  359.     mblk_t         *cp_private;    /* private state information */
  360.     long        cp_filler[4];    /* reserved for future use */
  361. };
  362.  
  363. #define cp_uid cp_cr->cr_uid
  364. #define cp_gid cp_cr->cr_gid
  365.  
  366.  
  367. /*
  368.  * Options structure for M_SETOPTS message.  This is sent upstream
  369.  * by a module or driver to set stream head options.
  370.  */
  371.  
  372.  
  373. struct stroptions {
  374.     ulong    so_flags;        /* options to set */
  375.     short    so_readopt;        /* read option */
  376.     ushort    so_wroff;        /* write offset */
  377.     long    so_minpsz;        /* minimum read packet size */
  378.     long    so_maxpsz;        /* maximum read packet size */
  379.     ulong    so_hiwat;        /* read queue high water mark */
  380.     ulong    so_lowat;        /* read queue low water mark */
  381.     unsigned char so_band;        /* band for water marks */
  382. #ifndef _IRIX_LATER
  383.     short    so_vtime;        /* polling read parameter */
  384.         short    so_tostop;        /* setting of TOSTOP flag */
  385. #endif /* !_IRIX_LATER */
  386. };
  387.  
  388.  
  389. /* flags for stream options set message */
  390.  
  391. #define SO_ALL        0x003f    /* set all old options */
  392. #define SO_READOPT    0x0001    /* set read option */
  393. #define SO_WROFF    0x0002    /* set write offset */
  394. #define SO_MINPSZ    0x0004    /* set min packet size */
  395. #define SO_MAXPSZ    0x0008    /* set max packet size */
  396. #define SO_HIWAT    0x0010    /* set high water mark */
  397. #define SO_LOWAT    0x0020    /* set low water mark */
  398. #define SO_MREADON      0x0040    /* set read notification ON */
  399. #define SO_MREADOFF     0x0080    /* set read notification OFF */
  400. #define SO_NDELON    0x0100    /* old TTY semantics for NDELAY reads/writes */
  401. #define SO_NDELOFF      0x0200    /* STREAMS semantics for NDELAY reads/writes */
  402. #define SO_ISTTY    0x0400    /* the stream is acting as a terminal */
  403. #define SO_ISNTTY    0x0800    /* the stream is not acting as a terminal */
  404. #define SO_TOSTOP    0x1000    /* stop on background writes to this stream */
  405. #define SO_TONSTOP    0x2000    /* do not stop on background writes to stream */
  406. #define SO_BAND        0x4000    /* water marks affect band */
  407. #define SO_DELIM    0x8000    /* messages are delimited */
  408. #define SO_NODELIM    0x010000    /* turn off delimiters */
  409. #define SO_STRHOLD    0x020000    /* enable strwrite message coalescing */
  410. #define SO_NOSTRHOLD    0x080000    /* disable strhold */
  411. #ifndef _IRIX_LATER
  412. #define SO_VTIME    0x040000 /* set vtime */
  413. #endif /* !_IRIX_LATER */
  414.  
  415. /*
  416.  * Structure for M_EVENT and M_PCEVENT messages.  This is sent upstream
  417.  * by a module or driver to have the stream head generate a call to the
  418.  * General Events subsystem.  It is also contained in the first M_DATA
  419.  * block of an M_IOCTL message for the I_STREV and I_UNSTREV ioctls.
  420.  */
  421. struct str_evmsg {
  422.     long         sv_event;    /* the event (module-specific) */
  423.     struct vnode    *sv_vp;        /* vnode pointer of event queue */
  424.     long         sv_eid;    /* same as ev_eid */
  425.     long         sv_evpri;    /* same as ev_pri */
  426.     long         sv_flags;    /* same as ev_flags */
  427.     uid_t         sv_uid;    /* user id of posting process */
  428.     pid_t         sv_pid;    /* process id of posting process */
  429.     hostid_t     sv_hostid;    /* host id of posting process */
  430.     long         sv_pad[4];    /* reserved for future use */
  431. };
  432.  
  433. /*
  434.  * queue information structure
  435.  */
  436. struct    qinit {
  437.     int    (*qi_putp)(queue_t *, mblk_t *); /* put procedure */
  438.     int    (*qi_srvp)(queue_t *);        /* service procedure */
  439.     int    (*qi_qopen)(queue_t *, dev_t *, int, int,
  440.                      struct cred *);    /* called on startup */
  441.     int    (*qi_qclose)(queue_t *, int, struct cred *);
  442.                             /* called on finish */
  443.     int    (*qi_qadmin)(void);        /* for future use */
  444.     struct module_info *qi_minfo;    /* module information structure */
  445.     struct module_stat *qi_mstat;    /* module statistics structure */
  446. };
  447.  
  448. /*
  449.  * Miscellaneous parameters and flags.
  450.  */
  451.  
  452. /*
  453.  * New code for two-byte M_ERROR message.
  454.  */
  455. #define NOERROR    ((unsigned char)-1)
  456.  
  457. /*
  458.  * Values for stream flag in open to indicate module open, clone open;
  459.  * return value for failure.
  460.  */
  461. #define MODOPEN     0x1        /* open as a module */
  462. #define CLONEOPEN    0x2        /* open for clone, pick own minor device */
  463. #define OPENFAIL    -1        /* returned for open failure */
  464.  
  465. /*
  466.  * Priority definitions for block allocation.
  467.  */
  468. #define BPRI_LO        1
  469. #define BPRI_MED    2
  470. #define BPRI_HI        3
  471.  
  472. /*
  473.  * Value for packet size that denotes infinity
  474.  */
  475. #define INFPSZ        -1
  476.  
  477. /*
  478.  * Flags for flushq()
  479.  */
  480. #define FLUSHALL    1    /* flush all messages */
  481. #define FLUSHDATA    0    /* don't flush control messages */
  482.  
  483. /*
  484.  * Flag for transparent ioctls
  485.  */
  486. #define TRANSPARENT    (unsigned int)(-1)
  487.  
  488. /*
  489.  * Sleep priorities for stream io
  490.  */
  491. #define    STIPRI    PZERO+3
  492. #define    STOPRI    PZERO+3
  493.  
  494. /*
  495.  * Stream head default high/low water marks 
  496.  */
  497. #define STRHIGH 5120
  498. #define STRLOW    1024
  499.  
  500. /*
  501.  * Block allocation parameters
  502.  */
  503. #define MAXIOCBSZ    1024        /* max ioctl data block size */
  504.  
  505. extern int strholdtime;
  506.  
  507. /*
  508.  * Definitions of Streams macros and function interfaces.
  509.  */
  510.  
  511. /*
  512.  * Definition of spl function needed to provide critical region protection
  513.  * for streams drivers and modules.
  514.  */
  515. extern int splstr(void);
  516.  
  517. /*
  518.  * canenable - check if queue can be enabled by putq().
  519.  */
  520. #define canenable(q)    !((q)->q_flag & QNOENB)
  521.  
  522. /*
  523.  * Finding related queues
  524.  */
  525. #define    OTHERQ(q)    ((q)->q_flag&QREADR? (q)+1: (q)-1)
  526. #define    WR(q)        ((q)+1)
  527. #define    RD(q)        ((q)-1)
  528. #define SAMESTR(q)    (((q)->q_next) && (((q)->q_flag&QREADR) == ((q)->q_next->q_flag&QREADR)))
  529.  
  530. /*
  531.  * Put a message of the next queue of the given queue.
  532.  */
  533. #define putnext(q, mp)    ((*(q)->q_next->q_qinfo->qi_putp)((q)->q_next, (mp)))
  534.  
  535. /*
  536.  * Test if data block type is one of the data messages (i.e. not a control
  537.  * message).
  538.  */
  539. #define datamsg(type) ((type) == M_DATA || (type) == M_PROTO || (type) == M_PCPROTO || (type) == M_DELAY)
  540.  
  541. /*
  542.  * Extract queue class of message block.
  543.  */
  544. #define queclass(bp) (((bp)->b_datap->db_type >= QPCTL) ? QPCTL : QNORM)
  545.  
  546. /*
  547.  * Align address on next lower word boundary.
  548.  */
  549. #define straln(a)    (caddr_t)((__psint_t)(a) & ~(sizeof(__psint_t)-1))
  550.  
  551. /*
  552.  * Find the max size of data block.
  553.  */
  554. #define bpsize(bp) ((unsigned int)(bp->b_datap->db_lim - bp->b_datap->db_base))
  555.  
  556. /*
  557.  * declarations of common routines
  558.  */
  559. extern mblk_t *allocb(int, uint);
  560. extern mblk_t *esballoc(unsigned char *, int, int, frtn_t *);
  561. extern toid_t esbbcall(int, void (*)(), long);
  562. extern int testb(int, uint);
  563. extern toid_t bufcall(uint, int, void (*)(), long);
  564. extern void unbufcall(toid_t);
  565. extern void freeb(mblk_t *);
  566. extern void freemsg(mblk_t *);
  567. extern mblk_t *dupb(mblk_t *);
  568. extern mblk_t *dupmsg(mblk_t *);
  569. extern mblk_t *copyb(mblk_t *);
  570. extern mblk_t *copymsg(mblk_t *);
  571. extern void linkb(mblk_t *, mblk_t *);
  572. extern mblk_t *unlinkb(mblk_t *);
  573. extern mblk_t *rmvb(mblk_t *, mblk_t *);
  574. extern int pullupmsg(mblk_t *, int);
  575. extern mblk_t *msgpullup(mblk_t *, int);
  576. extern int adjmsg(mblk_t *, int);
  577. extern int msgdsize(mblk_t *);
  578. extern mblk_t *getq(queue_t *);
  579. extern void rmvq(queue_t *, mblk_t *);
  580. extern void flushq(queue_t *, int);
  581. extern void flushband(queue_t *, unsigned char, int);
  582. extern int canput(queue_t *);
  583. extern int canputnext(queue_t *);
  584. extern int bcanput(queue_t *, unsigned char);
  585. extern int bcanputnext(queue_t *, unsigned char);
  586. extern void put(queue_t *, mblk_t *);
  587. extern int putq(queue_t *, mblk_t *);
  588. extern int putbq(queue_t *, mblk_t *);
  589. extern int insq(queue_t *, mblk_t *, mblk_t *);
  590. extern int putctl(queue_t *, int);
  591. extern int putnextctl(queue_t *, int);
  592. extern int putctl1(queue_t *, int, int);
  593. extern int putnextctl1(queue_t *, int, int);
  594. extern queue_t *backq(queue_t *);
  595. extern void qreply(queue_t *, mblk_t *);
  596. extern void qenable(queue_t *);
  597. extern int qsize(queue_t *);
  598. extern void noenable(queue_t *);
  599. extern void enableok(queue_t *);
  600. extern int strqset(queue_t *, qfields_t, unsigned char, long);
  601. extern int strqget(queue_t *, qfields_t, unsigned char, long *);
  602. extern int freezestr(queue_t *);    /* XXXrs pl_t */
  603. extern void unfreezestr(queue_t *, int);    /* XXXrs pl_t */
  604. extern void qprocson(queue_t *);
  605. extern void qprocsoff(queue_t *);
  606. extern int pcmsg(unsigned char);
  607.  
  608. #ifndef _IRIX_LATER
  609. extern int strdrv_push(queue_t *, char *, dev_t *, struct cred *);
  610. extern void sdrv_error(queue_t *, mblk_t *);
  611. extern void sdrv_flush(queue_t *, mblk_t *);
  612. extern mblk_t *str_allocb(int, queue_t *, uint);
  613. extern void str_unbcall(queue_t *);
  614. extern void str_conmsg(mblk_t **, mblk_t **, mblk_t *);
  615. #endif /* !_IRIX_LATER */
  616.  
  617. /*
  618.  * shared or externally configured data structures
  619.  */
  620. extern int nstrpush;            /* maxmimum number of pushes allowed */
  621. extern struct strstat strst;        /* STREAMS statistics structure */
  622.  
  623. #ifdef __cplusplus
  624. }
  625. #endif
  626.  
  627. #endif    /* _SYS_STREAM_H */
  628.